#ifndef Buffer_h
#define Buffer_h

#include "CountingSemaphore.h"
#include "Thread.h"
#include "Message.h"
#include <queue>

using std::queue;

class Buffer
{
public:
	Buffer(void);
	~Buffer(void);
	void push(Message* m, Thread* t);
	Message* pop(Thread* t);
	int getSize();
protected:
	Mutex* m_mutex;
	CountingSemaphore* m_full;
	queue<Message*>* m_buffer;
};
#endif

